from gelslimpi.visualize import qtcv
import cv2
from pathlib import Path
import numpy as np
import pandas as pd
BASE_DIR = Path(__file__).resolve().parent
data_dir = BASE_DIR /"runs/23_06_19_22_07_42"

if __name__ == '__main__':
    df = pd.read_csv(data_dir/"log.csv", usecols=[0, 1, 2, 3])
    print(df)

    for i in range(len(df)):
        img_path = str(data_dir / f"{df.iloc[i, 0]}_{df.iloc[i, 1]:>04d}.jpg")
        img_path = str(data_dir / f"{df.iloc[i, 1]:>04d}.jpg")
        img = cv2.imread(img_path)

        cv2.circle(img, (int(df.iloc[i, 2]), int(df.iloc[i, 3])), 5, (0, 0, 255), 2)
        qtcv.imshow("img", img)
        key = qtcv.waitKey(0)
        if key == qtcv.Key.Key_Escape:
            break



        # print(data[:10])
    # qtcv.imshow("a", img)